package com.github.baichuan.application.scaffold.rest.dto.app;

import com.github.baichuan.application.scaffold.rest.domain.app.App;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Getter;

@Schema(title = "当前版本信息")
@Getter
public class CurrentVersion {
    @Schema(title = "应用代码")
    @NotBlank(message = "应用代码不能为空")
    private String code;

    @Schema(title = "操作系统")
    @NotNull(message = "操作系统不能为空")
    private App.Platform platform;

    @Schema(title = "版本号")
    @NotBlank(message = "版本号不能为空")
    @Pattern(regexp = "^\\d+\\.\\d+\\.\\d+$")
    private String version;
}
